package com.myzxapp.Utils;

import android.content.Context;
import android.content.res.AssetManager;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;

public class AssetUtils {

    public static List<String> getFilesInAssets(Context context, String directory) {
        List<String> fileList = new ArrayList<>();
        AssetManager assetManager = context.getAssets();

        try {
            // 获取指定目录下的所有文件
            String[] files = assetManager.list(directory);
            if (files != null) {
                for (String file : files) {
                    fileList.add(directory+file);
                }
            }
        } catch (IOException e) {
            e.printStackTrace();
        }

        return fileList;
    }
}
